package com.uci.photogam;

import android.content.SharedPreferences;

public class SharedPreferenceManager {
	private SharedPreferences userSettings;
	private SharedPreferences.Editor editor;

	public SharedPreferenceManager(SharedPreferences sharedInstance) {
		userSettings = sharedInstance;
		editor = userSettings.edit();
	}

	public void putString(String key, String value) {
		editor.putString(key, value);
	}

	public void putInt(String key, int value) {
		editor.putInt(key, value);
	}

	public void commit() {
		editor.commit();
	}

	public String getString(String key, String defValue) {
		return userSettings.getString(key, defValue);
	}

	public int getInt(String key, int defValue) {
		return userSettings.getInt(key, defValue);
	}

	public boolean contains(String key) {
		return userSettings.contains(key);
	}

	public void clearPreferences() {
		editor.clear();
		editor.commit();
	}
}
